#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>

using namespace std;

int FirstUniqChar(string s)
{
	int* arr = new int[26] {0};
	int i = 0;
	int n = s.size();
	for (i = 0; i < n; ++i)
	{
		arr[s.at(i) - 'a']++;
	}
	for (i = 0; i < n; ++i)
	{
		if (arr[s.at(i) - 'a'] == 1)
		{
			return i;
		}
	}
	return -1;
}

int main()
{
	string s;
	cin >> s;
	int ret = FirstUniqChar(s);
	cout << s << endl;
	cout << ret << endl;
	return 0;
}